package com.frame.util;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;

import com.pioneer.app.dev.osuser.user.Userlist;


public class ImgSecurityTag extends TagSupport  {
	private PageContext pageContext;
	 private Tag parent;
	 private String name;
	 private String tip;
	 private String event;
	 private String target;
	 private String className;
	 private String src;
	 private String processcode;

	public String getProcesscode() {
		return processcode;
	}

	public void setProcesscode(String processcode) {
		this.processcode = processcode;
	}

	public String getSrc() {
		return src;
	}

	public void setSrc(String src) {
		this.src = src;
	}

	public String getEvent() {
		return event;
	}

	public void setEvent(String event) {
		this.event = event;
	}


	public String getTip() {
		return tip;
	}

	public void setTip(String tip) {
		this.tip = tip;
	}

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}


	public String getName() {
		return name;
	}

	//	 --------------function------------


	public void setParent(Tag parent) 
	{
		this.parent=parent;

	}

	public Tag getParent() 
	{
		
		return this.parent;
	}

	public int doStartTag() throws JspException 
	{
		
		//System.out.println("doStartTag");
		return Tag.SKIP_BODY;

	}

	public int doEndTag() throws JspException 
	{
		
		//System.out.println("doEndTag");
		  try 
		  {
		  	 StringBuffer message = new StringBuffer(500);  
			  	if(ProviewTest.isPreview(this.pageContext, processcode)){
			  		 message.append("<img src='").append(src).append("' onclick=\"").append(event).append("\" class='").append(className)
				  	 .append("' alt='").append(tip).append("' target='").append(target).append("'></img>");
			  	}
		  	this.pageContext.getOut().write(message.toString());
		  } catch (Exception e) 
		  {
		   e.printStackTrace();
		  }
		  return Tag.EVAL_PAGE;
	}
	 public void setName(String name) {      
		 this.name = name;    
		 }
	public void release() 
	{
		System.out.println("release");

	}

	public PageContext getPageContext() {
		return pageContext;
	}

	public void setPageContext(PageContext pageContext) {
		this.pageContext = pageContext;
	}


}
